package com.zpark.pojo;

import com.zpark.dao.GroupA;
import com.zpark.dao.GroupB;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

public class Person {
    private Integer userId;
    private String name;

    @Max(value = 40,message = "最大為40",groups = {GroupB.class})
    @Min(value = 30,message = "最小為30",groups = {GroupB.class})
    @Min(value = 20,message = "最小為20",groups = {GroupA.class})
    @Max(value = 30,message = "最大為30",groups = {GroupA.class})
    private Integer age;

//省略get和set方法
}